#include "PlayerHistory.h"

PlayerHistory::PlayerHistory()
{
	playedCards = Deck();
}

PlayerHistory::~PlayerHistory()
{
}

void PlayerHistory::addPlayedCard(Card * card)
{
	if(card!=0)
	{
		playedCards.addCard(card);
	}
}

void PlayerHistory::addCalledAnnonce(Annonces annonce)
{
	calledAnnonces.push_back(annonce);

	if(countOfCalledAnnonceBeforeContra.size()<=0)
		countOfCalledAnnonceBeforeContra.push_back(1);
	else
	{
		countOfCalledAnnonceBeforeContra[countOfCalledAnnonceBeforeContra.size()-1]++;
	}
}

void PlayerHistory::addCalledContra(Contra contra)
{
	calledContra.push_back(contra);
	countOfCalledAnnonceBeforeContra.push_back(0);
}

Card * PlayerHistory::getPlayedCardAt(unsigned int round)
{
	if(playedCards.getDeckSize()>round)
		return playedCards.getCardAt(round);
	return 0;
}